Skip to content

Allow specifiying data areas 1-4 when generating telemetry logs#2755

Closed
dsfw-opensource wants to merge 1 commit intolinux-nvme:masterfrom
dsfw-opensource:telemetry_get_data_area
Closed

Allow specifiying data areas 1-4 when generating telemetry logs#2755
dsfw-opensource wants to merge 1 commit intolinux-nvme:masterfrom
dsfw-opensource:telemetry_get_data_area

Conversation

@dsfw-opensource
Copy link
Copy Markdown

Allow users to specify data areas 1-4 when generating telemetry logs. Previously, the command is rejected if it is not 1 or 2. When users specify data area N, data areas <= N now get parsed into the output.

Closes: #2754

Allow users to specify data areas 1-4 when generating telemetry
logs. Previously, the command is rejected if it is not 1 or 2.
When users specify data area N, data areas <= N now get parsed
into the output.

Closes: linux-nvme#2754
Signed-off-by: dsfw-opensource <[email protected]>

if (pevent_fifos_object != NULL && root != NULL) {
const char *data_area = (poffsets->data_area == 1 ? STR_DA_1_EVENT_FIFO_INFO :
const char *data_area = (poffsets->data_area == DATA_AREA_1 ? STR_DA_1_EVENT_FIFO_INFO :
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the data area is 3 or 4 then the data area 2 event fifo information used but is it expected as correct?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also there are checkpatch.pl 2 warnings as below.

tokunori@tokunori-desktop:~/nvme-cli-2$ ~/linux/scripts/checkpatch.pl -g HEAD
WARNING: 'specifiying' may be misspelled - perhaps 'specifying'?
#4:
Subject: [PATCH] Allow specifiying data areas 1-4 when generating telemetry
                       ^^^^^^^^^^^

WARNING: line length of 104 exceeds 100 columns
#68: FILE: plugins/ocp/ocp-telemetry-decode.c:1226:
+               const char *data_area = (poffsets->data_area == DATA_AREA_1 ? STR_DA_1_EVENT_FIFO_INFO :

total: 0 errors, 2 warnings, 120 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

Commit ffa58cc6d956 ("Allow specifiying data areas 1-4 when generating telemetry logs") has style problems, please review.

NOTE: Ignored message types: EMAIL_SUBJECT FILE_PATH_CHANGES GERRIT_CHANGE_ID GIT_COMMIT_ID NOT_UNIFIED_DIFF

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the behavior makes sense. Is there a maintainer I can contact to confirm if this is the intended behavior? The specification is not very clear, but I based it on the original behavior where, if a user requested data area 2, they also received data areas 1 and 2 parsed into a human-readable format. Following that logic, I would expect data area 3 to include data areas 1 and 2 parsed into a human-readable format, with data areas >= 3 remaining in the raw binary log since it is vendor-specific.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The base spec has the following on telemetry log:

image

I assume the ocp spec will follow the base spec, so no need to include the areas 1,2 if 3 is selected.

To clarify this you could contact the authors of the ocp spec though.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I will try contacting the authors.

if (root != NULL && pstats_array != NULL) {
const char *pdata_area =
(poffsets->data_area == 1 ? STR_DA_1_STATS : STR_DA_2_STATS);
(poffsets->data_area == DATA_AREA_1 ? STR_DA_1_STATS : STR_DA_2_STATS);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this also correct to use the data area 2 statistics for the data area 3 or 4?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Data area 3 and 4 are vendor-specific. This is just to ensure data area 2 also gets parsed.

if (options->data_area >= DATA_AREA_2) {
//Set the DA to 2
offsets.data_area = 2;
offsets.data_area = DATA_AREA_2;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this also really expected for the data area 3 and 4?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anyway if for the option data area 3 or 4 specified it is expected to use the data area 2 internally then the description comment needed I think.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I will add a comment.

if (options->data_area == 2) {
offsets.data_area = 2;
if (options->data_area >= DATA_AREA_2) {
offsets.data_area = DATA_AREA_2;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not necessary to set DATA_AREA_3 or DATA_AREA_4 for the data area 3 and 4?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Data areas 3 and 4 are vendor specific.

struct nvme_ocp_telemetry_offsets offsets = { 0 };

offsets.data_area = 1;// Default DA - DA1
offsets.data_area = DATA_AREA_1;// Default DA - DA1
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Below seems better for the comment.

- 			offsets.data_area = DATA_AREA_1;// Default DA - DA1
+ 			offsets.data_area = DATA_AREA_1; /* Default DA - DA1 */

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, will change it.

@@ -1509,7 +1510,7 @@ int print_ocp_telemetry_normal(struct ocp_telemetry_parse_options *options)
//Set DA to 1 and get offsets
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Below seems better for the comment. Anyway a space needed after // I think.

- 			//Set DA to 1 and get offsets
+ 			/* Set DA to 1 and get offsets */

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I will change it.

@dsfw-opensource
Copy link
Copy Markdown
Author

Ok, I might of had a misunderstanding of the command. After thinking about it some more, it makes sense that nvme ocp internal-log <device> only supports 1 and 2 because they have a defined structure to parse. I will create a plugin for retrieving data areas 3 and 4. Sorry for the confusion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cannot specify data area 3 when generating telemetry log

3 participants